package com.tedu.bill.com.tedi.bill.demo1;

import java.io.IOException;

/**
 * Author：毕龙
 * Date: 2024/5/21 10:21
 */
public class TestExceptionCatch {
    public static void main(String[] args) {
       try{
           String str = null;
           int i = str.charAt(0);
       }catch (NullPointerException e){
           e.printStackTrace();
           System.out.println("空指针异常");
           System.out.println("异常处理了");
       }catch (RuntimeException e){
           e.printStackTrace();
           System.out.println("空指针异常");
           System.out.println("异常处理了");
       }catch (Exception e){
           e.printStackTrace();
           System.out.println("空指针异常");
           System.out.println("异常处理了");
       }
    }
}
